package com.atguigu.gmall.publisher.controller;

import com.alibaba.fastjson.JSON;
import com.atguigu.gmall.publisher.service.DauService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PublisherController {


    @Autowired
    DauService dauService;

    @GetMapping("/dauRealtime")
    public   String  getDauRealtime(@RequestParam("td") String today){

        Map<String, Object> dauStatsMap = dauService.getDauStats(today);
        return JSON.toJSONString(dauStatsMap);
    }
}
